package com.hll.util;

import jodd.http.HttpRequest;
import jodd.http.HttpResponse;

import java.util.HashMap;
import java.util.Map;

/**
 * 发送短信工具类
 */
public class SmsUtils {

    /**
     * M1.0 发送短信
     * @param phone
     * @param msg
     * @return
     */
    public static String sendSMS(String phone,String msg){
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("cpName", "PASSION");
        map.put("cpPwd", "123456");
        map.put("phones", phone);
        map.put("msg", msg);
        String URL = "http://api.itrigo.net/mt.jsp";
        HttpResponse httpResponse = HttpRequest.post(URL).form(map).send();
        int httpState = httpResponse.statusCode();
        String resMsg = httpResponse.acceptEncoding("utf-8").bodyText();

        return  resMsg;
    }


}
